<!DOCTYPE html>
<html lang="en">
  
  <head>
    <meta charset="UTF-8">
    <title>添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
			<h5 style="position: absolute;left: 40%;top:13%;font-size: 30px;">修改密码</h5>
    	  <div class="x-body" style="position: absolute;left: 30%;top:20%" >
    	  	<span style="color: red" th:text="${info}"></span>
    	 
        <form class="layui-form" action="/updateForm">
          <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>邮箱
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="email" name="email" required="" lay-verify="email"
                  autocomplete="off" class="layui-input">
              </div>
           
          </div>

          <div class="layui-form-item">
              <label class="layui-form-label">
                  <span class="x-red">*</span>验证码
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="code" name="code" required="" 
                  autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">*</span>
              </div>
          </div>
          <div class="layui-form-item">
              <label  class="layui-form-label">
                  <span class="x-red">*</span>新密码
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="surePwd" name="surePwd" required="" 
                  autocomplete="off" class="layui-input">
              </div>
           
          </div>
 
   
          <div class="layui-form-item">
              <label  class="layui-form-label">
              </label>
                 <button  class="layui-btn" type="button" onclick="sendCode()">
                  	发送验证码
              </button>
              <button  class="layui-btn" type="submit">
                  	修改
              </button>
          </div>
      </form>
    </div>

            <script>
                //发送验证码  jquery
                function sendCode() {
                    //获取用户输入的邮箱
                    var email = document.getElementById("email").value;
                    //发送ajax请求
                    $.ajax({

                        //请求的服务端地址
                        url:"/sendCode",

                        //请求方式
                        type:"get",

                        //请求的参数
                        data:{"email":email},

                        //返回的数据类型json  一般指的是js对象或者对象数组
                        dataType:"json",

                        success:function (data) {  //返回成功执行的回调函数
                            alert(data.info);

                        }
                    })
                };
            </script>
  </body>

</html>